package com.lyj.aspect;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Component
@Aspect
public class MyAspect {
    @Pointcut("execution(public void com.lyj.pojo.Dog3.*(..))")
    public void pointcut(){
    }
    @Around("pointcut()")
    public  Object f1(ProceedingJoinPoint joinpoint) throws Throwable {
        System.out.println("闻到了香味");
        Object o = joinpoint.proceed();
        System.out.println("在吃东西");
        return o;
    }
}
